﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;
using System.Web.Http.SelfHost;

namespace KorbeRTR.MES
{
    public class WebApiServer
    {
        public static HttpSelfHostConfiguration config = null;
        public static HttpSelfHostServer server = null;

        public static void StartWebApi()
        {
            config = new HttpSelfHostConfiguration("http://0.0.0.0:5001");
            config.Routes.MapHttpRoute("API Default", "RestAPI/{controller}");
            server = new HttpSelfHostServer(config);
            server.OpenAsync().Wait();
        }
    }
}
